﻿#region Using Directives

using System;

#endregion Using Directives

namespace SharePointStu.SharePoint.General
{
	/// <summary>
	/// Base exception class.
	/// </summary>
	public class BaseException : ApplicationException
	{
		#region Members

		/// <summary>
		/// Defines the details of the exception
		/// </summary>
		protected string _msg;

		#endregion Members

		#region Constructors and Destructors

		/// <summary>
        /// Initializes a new instance of the <see cref="T:SharePointStu.SharePoint.General.BaseException"/> class.
		/// </summary>
		public BaseException()
		{
            _msg = Exceptions.BaseException;
		}

		/// <summary>
		/// Creates a new BaseException with the default message and the supplied inner exception.
		/// </summary>
		/// <param name="msg">The exception message text.</param>
		/// <param name="innerException">The inner exception object.</param>
		/// <remarks>Note that msg must be localized before the call and only
		/// refers to the InnerException message.  The Message for the derived class
		/// must still be manually set and localized as normal.
		/// </remarks>
		public BaseException(string msg, Exception innerException)
			: base(msg, innerException)
		{
			_msg = msg;
		}

		/// <summary>
		/// Creates a new instance of the Exception with the given exception details
		/// </summary>
		/// <param name="details">Provides information concerning the exception</param>
        public BaseException(string details)
		{
            string s = Exceptions.BaseException;
			_msg = string.Format(s, details);
		}

		#endregion Constructors and Destructors

		#region Public Properties

		/// <summary>
		/// Provides a description of the exception
		/// </summary>
		public override string Message
		{
			get { return _msg; }
		}

		#endregion Public Properties
	}
}
